﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/AdminDefault.Master"
  AutoEventWireup="true" CodeBehind="ProCategoryDetail.aspx.cs" Inherits="ITViet.Web.Admin.ProCategoryDetail" %>

<%@ Register Assembly="DevExpress.Web.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dxcb" %>
<%@ Register Assembly="DevExpress.Web.ASPxHtmlEditor.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxHtmlEditor" TagPrefix="dxhe" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.ASPxSpellChecker.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxSpellChecker" TagPrefix="dxwsc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <div>
    <table width="100%">
      <tr>
        <td>
          <asp:Label runat="server" Text="<%$ Resources:Strings, Language %>"></asp:Label>
        </td>
        <td style="padding-left: 5px;">
          <dxe:ASPxComboBox ID="cbbLanguage" runat="server" ClientInstanceName="cbbLanguage"
            ValueField="Id" TextField="Value" DataSourceID="xdsLanguage" ValueType="System.Int32">
            <ClientSideEvents ValueChanged="function(s,e){cbbLanguage_ValueChanged();}" />
          </dxe:ASPxComboBox>
        </td>
      </tr>
      <tr>
        <td>
          <asp:Label runat="server" Text="<%$ Resources:Strings, Name %>"></asp:Label>
        </td>
        <td style="padding-left: 5px;">
          <dxe:ASPxTextBox ID="txtName" runat="server" ClientInstanceName="txtName" Width="100%"
            Height="25px">
          </dxe:ASPxTextBox>
        </td>
      </tr>
      <tr>
        <td>
          <asp:Label runat="server" Text="<%$ Resources:Strings, Description %>"></asp:Label>
        </td>
        <td style="padding-left: 5px;">
          <dxhe:ASPxHtmlEditor ID="hdDescription" runat="server" Width="672px" ClientInstanceName="hdDescription">
            <SettingsImageUpload UploadImageFolder="~/Upload/Images/">
              <ValidationSettings AllowedContentTypes="image/jpeg,image/pjpeg,image/gif,image/png,image/x-png">
              </ValidationSettings>
            </SettingsImageUpload>
            <Toolbars>
              <dxhe:StandardToolbar1>
                <Items>
                  <dxhe:ToolbarCutButton>
                  </dxhe:ToolbarCutButton>
                  <dxhe:ToolbarCopyButton>
                  </dxhe:ToolbarCopyButton>
                  <dxhe:ToolbarPasteButton>
                  </dxhe:ToolbarPasteButton>
                  <dxhe:ToolbarPasteFromWordButton>
                  </dxhe:ToolbarPasteFromWordButton>
                  <dxhe:ToolbarUndoButton BeginGroup="True">
                  </dxhe:ToolbarUndoButton>
                  <dxhe:ToolbarRedoButton>
                  </dxhe:ToolbarRedoButton>
                  <dxhe:ToolbarRemoveFormatButton BeginGroup="True">
                  </dxhe:ToolbarRemoveFormatButton>
                  <dxhe:ToolbarSuperscriptButton BeginGroup="True">
                  </dxhe:ToolbarSuperscriptButton>
                  <dxhe:ToolbarSubscriptButton>
                  </dxhe:ToolbarSubscriptButton>
                  <dxhe:ToolbarInsertOrderedListButton BeginGroup="True">
                  </dxhe:ToolbarInsertOrderedListButton>
                  <dxhe:ToolbarInsertUnorderedListButton>
                  </dxhe:ToolbarInsertUnorderedListButton>
                  <dxhe:ToolbarIndentButton BeginGroup="True">
                  </dxhe:ToolbarIndentButton>
                  <dxhe:ToolbarOutdentButton>
                  </dxhe:ToolbarOutdentButton>
                  <dxhe:ToolbarInsertLinkDialogButton BeginGroup="True">
                  </dxhe:ToolbarInsertLinkDialogButton>
                  <dxhe:ToolbarUnlinkButton>
                  </dxhe:ToolbarUnlinkButton>
                  <dxhe:ToolbarInsertImageDialogButton>
                  </dxhe:ToolbarInsertImageDialogButton>
                  <dxhe:ToolbarCheckSpellingButton BeginGroup="True">
                  </dxhe:ToolbarCheckSpellingButton>
                  <dxhe:ToolbarFontColorButton>
                  </dxhe:ToolbarFontColorButton>
                  <dxhe:ToolbarBackColorButton>
                  </dxhe:ToolbarBackColorButton>
                </Items>
              </dxhe:StandardToolbar1>
              <dxhe:StandardToolbar2>
                <Items>
                  <dxhe:ToolbarParagraphFormattingEdit Width="130px">
                    <Items>
                      <dxhe:ToolbarListEditItem Text="Normal" Value="p" />
                      <dxhe:ToolbarListEditItem Text="Heading  1" Value="h1" />
                      <dxhe:ToolbarListEditItem Text="Heading  2" Value="h2" />
                      <dxhe:ToolbarListEditItem Text="Heading  3" Value="h3" />
                      <dxhe:ToolbarListEditItem Text="Heading  4" Value="h4" />
                      <dxhe:ToolbarListEditItem Text="Heading  5" Value="h5" />
                      <dxhe:ToolbarListEditItem Text="Heading  6" Value="h6" />
                      <dxhe:ToolbarListEditItem Text="Address" Value="address" />
                      <dxhe:ToolbarListEditItem Text="Normal (DIV)" Value="div" />
                    </Items>
                  </dxhe:ToolbarParagraphFormattingEdit>
                  <dxhe:ToolbarFontNameEdit Width="170px">
                    <Items>
                      <dxhe:ToolbarListEditItem Text="Times New Roman" Value="Times New Roman" />
                      <dxhe:ToolbarListEditItem Text="Tahoma" Value="Tahoma" />
                      <dxhe:ToolbarListEditItem Text="Verdana" Value="Verdana" />
                      <dxhe:ToolbarListEditItem Text="Arial" Value="Arial" />
                      <dxhe:ToolbarListEditItem Text="MS Sans Serif" Value="MS Sans Serif" />
                      <dxhe:ToolbarListEditItem Text="Courier" Value="Courier" />
                    </Items>
                  </dxhe:ToolbarFontNameEdit>
                  <dxhe:ToolbarFontSizeEdit Width="120px">
                    <Items>
                      <dxhe:ToolbarListEditItem Text="1 (8pt)" Value="1" />
                      <dxhe:ToolbarListEditItem Text="2 (10pt)" Value="2" />
                      <dxhe:ToolbarListEditItem Text="3 (12pt)" Value="3" />
                      <dxhe:ToolbarListEditItem Text="4 (14pt)" Value="4" />
                      <dxhe:ToolbarListEditItem Text="5 (18pt)" Value="5" />
                      <dxhe:ToolbarListEditItem Text="6 (24pt)" Value="6" />
                      <dxhe:ToolbarListEditItem Text="7 (36pt)" Value="7" />
                    </Items>
                  </dxhe:ToolbarFontSizeEdit>
                  <dxhe:ToolbarBoldButton BeginGroup="True">
                  </dxhe:ToolbarBoldButton>
                  <dxhe:ToolbarItalicButton>
                  </dxhe:ToolbarItalicButton>
                  <dxhe:ToolbarUnderlineButton>
                  </dxhe:ToolbarUnderlineButton>
                  <dxhe:ToolbarStrikethroughButton>
                  </dxhe:ToolbarStrikethroughButton>
                  <dxhe:ToolbarJustifyLeftButton BeginGroup="True">
                  </dxhe:ToolbarJustifyLeftButton>
                  <dxhe:ToolbarJustifyCenterButton>
                  </dxhe:ToolbarJustifyCenterButton>
                  <dxhe:ToolbarJustifyRightButton>
                  </dxhe:ToolbarJustifyRightButton>
                  <dxhe:ToolbarJustifyFullButton>
                  </dxhe:ToolbarJustifyFullButton>
                </Items>
              </dxhe:StandardToolbar2>
            </Toolbars>
          </dxhe:ASPxHtmlEditor>
        </td>
      </tr>
      <tr>
        <td>
        </td>
        <td style="padding-left: 5px;">
          <table>
            <tr>
              <td>
                <dxe:ASPxButton Width="80px" ID="btnSave" Text="<%$ Resources:Strings, Save %>" AutoPostBack="false"
                  ClientInstanceName="btnSave" runat="server">
                  <ClientSideEvents Click="function(s,e){btnSave_Click();}" />
                </dxe:ASPxButton>
              </td>
              <td style="padding-left:5px;" dir="ltr">
                <dxe:ASPxButton Width="80px" ID="btnback" Text="<%$ Resources:Strings, BackTo %>"
                  AutoPostBack="false" ClientInstanceName="btnSave" runat="server">
                  <ClientSideEvents Click="function(){BackTo();}" />
                </dxe:ASPxButton>
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
  </div>
  <div>
    <asp:XmlDataSource ID="xdsLanguage" runat="server" XPath="Items/LanguageDisplay/Status">
    </asp:XmlDataSource>
    <asp:HiddenField ID="hfCategoryId" runat="server" />
    <asp:HiddenField ID="hfLocaleId" runat="server" />
    <dxcb:ASPxCallback ID="ctrlCallback" runat="server" ClientInstanceName="ctrlCallback"
      OnCallback="ctrlCallback_Callback">
      <ClientSideEvents CallbackComplete="function (s,e){ctrlCallback_CallbackComplete(s,e);}" />
    </dxcb:ASPxCallback>

    <script type="text/javascript" language="javascript">
      function btnSave_Click() {
        pcWaiting.Show();
        ctrlCallback.SendCallback("save");
      }
      function ctrlCallback_CallbackComplete(s, e) {
        
        if (e.result.indexOf("save") != -1) {
          SaveLocale(e.result);
          return;
        }
        if (e.result.indexOf("[language]") != -1) {
          LoadContent(e.result);
        }
      }
      function SaveLocale(rs) {
        pcWaiting.Hide();
        if (rs.indexOf("error") != -1)
          alertMessage(rs);
        else
          alertMessage('<%=(string)GetGlobalResourceObject("Messages","ERR0005") %>');
      }
      function LoadContent(rs) {
        var values = rs.split('|');
        txtName.SetText(values[1]);
        hdDescription.SetHtml(values[2]);
        document.getElementById("<%=hfLocaleId.ClientID %>").value = values[3];
      }
      function cbbLanguage_ValueChanged() {
        ctrlCallback.SendCallback("language");
      }
      function BackTo() {
        window.location.href = "ProCategoryList.aspx";
      }
    </script>

  </div>
</asp:Content>
